<template>
    <el-dialog :close-on-click-modal="false"  ref="dialogform" :title="title" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
        <el-table :data="data" style="width: 100%" border>
            <!-- <el-table-column prop="item1" label="批次名称" width="180">
            </el-table-column>
            <el-table-column prop="item2" label="批次号">
            </el-table-column> -->
            <el-table-column prop="item3" label="养殖类别">
            </el-table-column>
            <el-table-column prop="item4" label="养殖品种">
            </el-table-column>
            <el-table-column prop="item5" label="养殖数量">
            </el-table-column>
            <el-table-column prop="item6" label="养殖重量">
            </el-table-column>
            <!-- <el-table-column label="操作" width="180">
                <template slot-scope="scope">
                    <span @click="handleClick(scope.row)" type="text" class="disable btn" size="small">删除</span>
                    <span @click="handleClick(scope.row)" type="text" class="primary btn" size="small">编辑</span>
                </template>
            </el-table-column> -->
        </el-table>
        <span slot="footer" class="dialog-footer">
            <el-button @click="cancel">关 闭</el-button>
        </span>
    </el-dialog>
</template>
<script>
export default {
    components: {},
    props: {
        addEditFlag: {
            type: String,
            default: () => {
                return 'add'
            }
        },
        data: {
            type: Array,
            default: () => {
                return [{
                    item1: 'batch_20230101',
                    item2: 'batchNo_01',
                    item3: '鱼',
                    item4: '皖鱼',
                    item5: '10000',
                    item6: '10000',
                    item7: '是'
                }, {
                    item1: 'batch_20230102',
                    item2: 'batchNo_02',
                    item3: '鱼',
                    item4: '草鱼',
                    item5: '10000',
                    item6: '10000',
                    item7: '是'
                }]
            }
        },
        title: {
            type: String,
            default: () => {
                return '操作表单'
            }
        },
        dialogVisible: {
            type: Boolean,
            default: () => {
                return false
            }
        }
    },
    data () {
        return {
            addEditApi: '',
            ruleForm: {},
            rules: {
                item1: [
                    { required: true, message: '请输入批次名称', trigger: 'change' }
                ],
                item2: [
                    { required: true, message: '请选择养殖设施', trigger: 'change' }
                ]
            }
        }
    },
    computed: {

    },
    watch: {},
    
    mounted () { },
    methods: {
        //取消关闭
        cancel () {
            this.$emit("closeDialog")
        },
        handleClose (done) {
            this.$confirm('确认关闭？')
                .then(_ => { this.cancel () })
                .catch(_ => { });
        }
    }
};
</script>
<style lang="scss" scoped>
.btn {
    padding: 0 5px;
}
</style>